﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HECore.ServiceFrame.Models
{
    /// <summary>
    /// 框架配置
    /// </summary>
    public class FrameConfig
    {
        /// <summary>
        /// 服务配置
        /// </summary>
        public FrameConfigService Service { get; set; }
        /// <summary>
        /// Fabio配置
        /// </summary>
        public FrameConfigFabio Fabio { get; set; }
        /// <summary>
        /// Consul配置
        /// </summary>
        public FrameConfigConsul Consul { get; set; }
    }

    /// <summary>
    /// 服务配置
    /// </summary>
    public class FrameConfigService
    {
        /// <summary>
        /// 服务名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 服务IP
        /// </summary>
        public string IP { get; set; }
        /// <summary>
        /// 服务端口
        /// </summary>
        public int Port { get; set; }
    }

    /// <summary>
    /// Fabio配置
    /// </summary>
    public class FrameConfigFabio
    {
        /// <summary>
        /// Fabio定义路由的标签配置前缀
        /// 与Fabio服务registry.consul.tagprefix保持一致
        /// https://fabiolb.net/ref/registry.consul.tagprefix/
        /// </summary>
        public string Tagprefix { get; set; }
    }

    /// <summary>
    /// Cousul配置
    /// </summary>
    public class FrameConfigConsul
    {
        /// <summary>
        /// Consul服务地址
        /// </summary>
        public string Address { get; set; }
    }
}